import request from '@/config/axios'

// 项目基线表单 VO
export interface RequireBaselineComparisonVO {
  id: number // 自增主键
  baseline1Id: string // 参与比较的第一条需求基线 ID
  baseline2Id: string // 参与比较的第二条需求基线 ID
  comparisonTime: Date // 基线比较操作时间
  comparer: string // 基线比较操作用户
  differenceDescription: string // 两条基线差异描述
}

// 项目基线表单 API
export const RequireBaselineComparisonApi = {
  // 查询项目基线表单分页
  getRequireBaselineComparisonPage: async (params: any) => {
    return await request.get({ url: `/project/require-baseline-comparison/page`, params })
  },

  // 查询项目基线表单详情
  getRequireBaselineComparison: async (id: number) => {
    return await request.get({ url: `/project/require-baseline-comparison/get?id=` + id })
  },

  // 新增项目基线表单
  createRequireBaselineComparison: async (data: RequireBaselineComparisonVO) => {
    return await request.post({ url: `/project/require-baseline-comparison/create`, data })
  },

  // 修改项目基线表单
  updateRequireBaselineComparison: async (data: RequireBaselineComparisonVO) => {
    return await request.put({ url: `/project/require-baseline-comparison/update`, data })
  },

  // 删除项目基线表单
  deleteRequireBaselineComparison: async (id: number) => {
    return await request.delete({ url: `/project/require-baseline-comparison/delete?id=` + id })
  },

  // 导出项目基线表单 Excel
  exportRequireBaselineComparison: async (params) => {
    return await request.download({ url: `/project/require-baseline-comparison/export-excel`, params })
  },
}